@import './common/var.css';

.van-field {

  width: 100%;
  position: relative;

  .van-cell__title,
  .van-cell__value {
    float: none;
    box-sizing: border-box;
  }

  .van-cell__title {
    width: 90px;
    position: absolute;
    top: 10px;
    left: 0;
  }

  .van-cell__value {
    width: 100%;
    padding-left: 90px;
    position: relative;
  }

  &--has-textarea {
    .van-field__control {
      min-height: 196px;
    }
    .van-field__counter {
      position: absolute;
      right: 0;
      bottom: 0;
    }
    .van-field__price {
      position: absolute;
      left: 0;
      bottom: 0;
      color: #EA5A49;
    }
  }

  &--nolabel {
    .van-cell__title {
      display: none;
    }

    .van-cell__value {
      width: 100%;
      padding-left: 0;
    }
  }

  &--disabled {
    .van-field__control {
      color: $gray-dark;
    }
  }

  &--error {
    .van-field__control {
      &,
      &::placeholder {
        color: $red;
      }
    }
  }

  &--border {
    .van-field__control {
      padding-left: 10px;
    }

    &::after {
      border-radius: 2px;
    }
  }

  &--autosize {
    .van-field__control {
      min-height: 0;
    }
  }

  &--has-icon {
    .van-field__control {
      width: 90%;
    }
  }

  &__control {
    border: 0;
    font-size: 14px;
    line-height: 24px;
    height: 24px;
    padding: 0;
    display: block;
    width: 100%;
    resize: none;
    color: $gray-lighter;

    &[disabled] {
      background-color: transparent;
    }
  }

  &__icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate3d(0, -50%, 0);
    padding: 10px;

    .van-icon {
      display: block;
    }
  }
}
